package com.think.teaching.utils;

public class UUIDUtils {
	private static final byte[] lock = new byte[0];

	public static String CreateUUID() {
		long r;
		long w = 1000;
		
		synchronized (lock) {
			r = (long) ((Math.random() + 1) * w);
		}

		return System.currentTimeMillis() + String.valueOf(r).substring(1);
	}
	
	public static long CreateLongUUID() {
		return 	Long.parseLong(CreateUUID());
	}
}
